FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-bionic
WORKDIR /app
EXPOSE 80
EXPOSE 443

#ENV ASPNETCORE_HOSTINGSTARTUPASSEMBLIES=SkyAPM.Agent.AspNetCore
#ENV SKYWALKING__SERVICENAME=MuXue.Zyiz.Template.WebApi
ENV LANG zh_CN.UTF-8
ENV LANGUAGE $LANG
ENV LC_ALL $LANG
ENV TZ=Asia/Shanghai
RUN echo $TZ > /etc/timezone && \
    apt-get update && apt-get install -y tzdata && \
    rm /etc/localtime && \
    ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && \
    dpkg-reconfigure -f noninteractive tzdata && \
    apt-get clean
RUN mkdir -p /usr/local/tomcat/webapps

COPY publish ./

# install tingyun agent
#RUN chmod +x ./tingyun-agent-netcore-1.5.2.bin
#RUN ./tingyun-agent-netcore-1.5.2.bin --license=vvvvvcccccc
#RUN rm -f ./tingyun-agent-netcore-1.5.2.bin

# setup env for tingyun agent
#ENV CORECLR_ENABLE_PROFILING 1		
#ENV CORECLR_PROFILER {8BEB2128-D285-4E1D-91B6-11ACD43EC0EE}		
#ENV CORECLR_PROFILER_PATH /usr/lib/tingyun-dotnet/x64/tingyun_profiler.so
#ENV LD_LIBRARY_PATH /usr/lib/tingyun-dotnet/x64:$LD_LIBRARY_PATH
#ENV TINGYUN_NETCORE_HOME /usr/lib/tingyun-dotnet
#ENV TINGYUN_APP_NAME zyiz-api

RUN chmod +x ./entrypoint.sh
ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
CMD ["dotnet", "MuXue.Zyiz.Template.WebApi.dll"]
